package com.fingard.dsp.bank.reqrespobj.auth.detail;

import java.util.HashMap;

import com.fingard.xml.XElement;

public class ReqAuthDetail {
	/** 鉴权流水号 */
    public String askNumber;
    
    /** 鉴权类型 (01-身份认证, 02-卡信息认证) */
    public String authType;
    
    /** 鉴权要素 3-三要素 , 4-四要素 */
    public String validElement;
    
    /** 鉴权用户账号 */
    public String authAct;
    
    /** 鉴权用户户名 */
    public String authName;
    
    /** 卡类型 (1-折, 2-借记卡 , 3-贷记卡 ,4-准贷记卡) */
    public String cardType;
    
    /** 证件类型 ( 0-身份证) */
    public String certType;
    
    /** 证件号 */
    public String certNum;
    
    /**手机号*/
    public String cellPhone;
    
    public XElement srcXElement;
    
	public ReqAuthDetail(XElement p_xelement) throws Exception{
    	srcXElement = p_xelement;
    	askNumber = p_xelement.getSingleText("ReqSeqID");
    	authType = p_xelement.getSingleText("AuthType");
    	validElement = p_xelement.getSingleText("ValidElement");
    	authAct = p_xelement.getSingleText("AuthAct");
    	authName = p_xelement.getSingleText("AuthName");
    	cardType = p_xelement.getSingleTextNotNull("CardType");
    	certType = p_xelement.getSingleTextNotNull("CertType");
    	certNum = p_xelement.getSingleTextNotNull("CertNum");
    	cellPhone = p_xelement.getSingleTextNotNull("CellPhone");
    }
	
	public ReqAuthDetail(HashMap<String, String> p_hashParam) throws Exception {
		if(p_hashParam.containsKey("ReqSeqID")){
			askNumber = p_hashParam.get("ReqSeqID");
		} else if(p_hashParam.containsKey("RdSeq")){
			askNumber = p_hashParam.get("RdSeq");
		}
		if(p_hashParam.containsKey("AuthType")){
			authType = p_hashParam.get("AuthType");
		}
		if(p_hashParam.containsKey("ValidElement")){
			validElement = p_hashParam.get("ValidElement");
		}
		if(p_hashParam.containsKey("AuthAct")){
			authAct = p_hashParam.get("AuthAct");
		}
		if(p_hashParam.containsKey("AuthName")){
			authName = p_hashParam.get("AuthName");
		}
	    if(p_hashParam.containsKey("CardType")){
			cardType = p_hashParam.get("CardType");
		}
		if(p_hashParam.containsKey("CertType")){
			certType = p_hashParam.get("CertType");
		}
		if(p_hashParam.containsKey("CertNum")){
			certNum = p_hashParam.get("CertNum");
		}
		if(p_hashParam.containsKey("CellPhone")){
			cellPhone = p_hashParam.get("CellPhone");
		}
	}
}
